package com.ruoyi.trade.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 成交记录对象 transaction_records
 *
 * @author ruoyi
 * @date 2025-08-06
 */
public class TransactionRecords extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键id */
    private Long id;

    /** 清算日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "清算日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date settlementDate;

    /** 合约编码 */
    @Excel(name = "合约编码")
    private String contractCode;

    /** 合约简称 */
    @Excel(name = "合约简称")
    private String contractAbbreviation;

    /** 买卖方向：0-买入，1-卖出 */
    @Excel(name = "买卖方向", readConverterExp = "0=买入,1=卖出") // 添加转换规则
    private Integer tradeDirection;

    /** 开平：0-开仓，1-平仓 */
    @Excel(name = "开平", readConverterExp = "0=开仓,1=平仓") // 确保格式正确
    private Integer positionAction;

    /** 成交价格 */
    @Excel(name = "成交价格")
    private BigDecimal executionPrice;

    /** 成交数量 */
    @Excel(name = "成交数量")
    private Long executedQuantity;

    /** 成交金额 */
    @Excel(name = "成交金额")
    private BigDecimal executedAmount;

    /** 委托价格 */
    @Excel(name = "委托价格")
    private BigDecimal orderPrice;

    /** 委托数量 */
    @Excel(name = "委托数量")
    private Long orderQuantity;

    /** 类别：0-认购，1-认沽 */
    @Excel(name = "类别", readConverterExp = "0=认购,1=认沽")
    private Integer optionType;

    /** 备兑：0-非备兑，1-备兑 */
    @Excel(name = "备兑", readConverterExp = "0=非备兑,1=备兑")
    private Integer covered;

    /** 委托号 */
    @Excel(name = "委托号")
    private String orderId;

    /** 委托时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "委托时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date orderTime;

    /** 交易市场 */
    @Excel(name = "交易市场")
    private String tradingMarket;

    /** 合同编号 */
    @Excel(name = "合同编号")
    private String contractNumber;

    /** 印花税率 */
    @Excel(name = "印花税率")
    private BigDecimal stampDutyRate;

    /** 经手费 */
    @Excel(name = "经手费")
    private BigDecimal brokerageFee;

    /** 证管费 */
    @Excel(name = "证管费")
    private BigDecimal regulatoryFee;

    /** 清算费 */
    @Excel(name = "清算费")
    private BigDecimal settlementFee;

    /** 过户费 */
    @Excel(name = "过户费")
    private BigDecimal transferFee;

    /** 交易过户费 */
    @Excel(name = "交易过户费")
    private BigDecimal transactionTransferFee;

    /** 行权过户费 */
    @Excel(name = "行权过户费")
    private BigDecimal exerciseTransferFee;

    /** 交易规费 */
    @Excel(name = "交易规费")
    private BigDecimal transactionLevy;

    /** 佣金 */
    @Excel(name = "佣金")
    private BigDecimal commission;

    /** 清算金额 */
    @Excel(name = "清算金额")
    private BigDecimal settlementAmount;

    /** 利润分组 */
    private String profitGroup;

    /** 交割月 */
    private String deliveryMonth;

    /** 清算标识：0-未清算，1-已清算 */
    private Integer clearFlag;

    /** 杠杆数量 */
    private Long leverageQuantity;

    /** 其他损益费 */
    private BigDecimal otherPlFee;

    /** 其他损益描述 */
    private String otherPlDescription;

    /** 备用金 */
    private Long reserveFund;

    /** 清算组编号 */
    private Long clearGroupNumber;

    /** 创建时间 */
    private Date createdAt;

    /** 更新时间 */
    private Date updatedAt;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getSettlementDate() {
        return settlementDate;
    }

    public void setSettlementDate(Date settlementDate) {
        this.settlementDate = settlementDate;
    }

    public String getContractCode() {
        return contractCode;
    }

    public void setContractCode(String contractCode) {
        this.contractCode = contractCode;
    }

    public String getContractAbbreviation() {
        return contractAbbreviation;
    }

    public void setContractAbbreviation(String contractAbbreviation) {
        this.contractAbbreviation = contractAbbreviation;
    }

    public Integer getTradeDirection() {
        return tradeDirection;
    }

    public void setTradeDirection(Integer tradeDirection) {
        this.tradeDirection = tradeDirection;
    }

    public Integer getPositionAction() {
        return positionAction;
    }

    public void setPositionAction(Integer positionAction) {
        this.positionAction = positionAction;
    }

    public BigDecimal getExecutionPrice() {
        return executionPrice;
    }

    public void setExecutionPrice(BigDecimal executionPrice) {
        this.executionPrice = executionPrice;
    }

    public Long getExecutedQuantity() {
        return executedQuantity;
    }

    public void setExecutedQuantity(Long executedQuantity) {
        this.executedQuantity = executedQuantity;
    }

    public BigDecimal getExecutedAmount() {
        return executedAmount;
    }

    public void setExecutedAmount(BigDecimal executedAmount) {
        this.executedAmount = executedAmount;
    }

    public BigDecimal getOrderPrice() {
        return orderPrice;
    }

    public void setOrderPrice(BigDecimal orderPrice) {
        this.orderPrice = orderPrice;
    }

    public Long getOrderQuantity() {
        return orderQuantity;
    }

    public void setOrderQuantity(Long orderQuantity) {
        this.orderQuantity = orderQuantity;
    }

    public Integer getOptionType() {
        return optionType;
    }

    public void setOptionType(Integer optionType) {
        this.optionType = optionType;
    }

    public Integer getCovered() {
        return covered;
    }

    public void setCovered(Integer covered) {
        this.covered = covered;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public Date getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(Date orderTime) {
        this.orderTime = orderTime;
    }

    public String getTradingMarket() {
        return tradingMarket;
    }

    public void setTradingMarket(String tradingMarket) {
        this.tradingMarket = tradingMarket;
    }

    public String getContractNumber() {
        return contractNumber;
    }

    public void setContractNumber(String contractNumber) {
        this.contractNumber = contractNumber;
    }

    public BigDecimal getStampDutyRate() {
        return stampDutyRate;
    }

    public void setStampDutyRate(BigDecimal stampDutyRate) {
        this.stampDutyRate = stampDutyRate;
    }

    public BigDecimal getBrokerageFee() {
        return brokerageFee;
    }

    public void setBrokerageFee(BigDecimal brokerageFee) {
        this.brokerageFee = brokerageFee;
    }

    public BigDecimal getRegulatoryFee() {
        return regulatoryFee;
    }

    public void setRegulatoryFee(BigDecimal regulatoryFee) {
        this.regulatoryFee = regulatoryFee;
    }

    public BigDecimal getSettlementFee() {
        return settlementFee;
    }

    public void setSettlementFee(BigDecimal settlementFee) {
        this.settlementFee = settlementFee;
    }

    public BigDecimal getTransferFee() {
        return transferFee;
    }

    public void setTransferFee(BigDecimal transferFee) {
        this.transferFee = transferFee;
    }

    public BigDecimal getTransactionTransferFee() {
        return transactionTransferFee;
    }

    public void setTransactionTransferFee(BigDecimal transactionTransferFee) {
        this.transactionTransferFee = transactionTransferFee;
    }

    public BigDecimal getExerciseTransferFee() {
        return exerciseTransferFee;
    }

    public void setExerciseTransferFee(BigDecimal exerciseTransferFee) {
        this.exerciseTransferFee = exerciseTransferFee;
    }

    public BigDecimal getTransactionLevy() {
        return transactionLevy;
    }

    public void setTransactionLevy(BigDecimal transactionLevy) {
        this.transactionLevy = transactionLevy;
    }

    public BigDecimal getCommission() {
        return commission;
    }

    public void setCommission(BigDecimal commission) {
        this.commission = commission;
    }

    public BigDecimal getSettlementAmount() {
        return settlementAmount;
    }

    public void setSettlementAmount(BigDecimal settlementAmount) {
        this.settlementAmount = settlementAmount;
    }

    public String getProfitGroup() {
        return profitGroup;
    }

    public void setProfitGroup(String profitGroup) {
        this.profitGroup = profitGroup;
    }

    public String getDeliveryMonth() {
        return deliveryMonth;
    }

    public void setDeliveryMonth(String deliveryMonth) {
        this.deliveryMonth = deliveryMonth;
    }

    public Integer getClearFlag() {
        return clearFlag;
    }

    public void setClearFlag(Integer clearFlag) {
        this.clearFlag = clearFlag;
    }

    public Long getLeverageQuantity() {
        return leverageQuantity;
    }

    public void setLeverageQuantity(Long leverageQuantity) {
        this.leverageQuantity = leverageQuantity;
    }

    public BigDecimal getOtherPlFee() {
        return otherPlFee;
    }

    public void setOtherPlFee(BigDecimal otherPlFee) {
        this.otherPlFee = otherPlFee;
    }

    public String getOtherPlDescription() {
        return otherPlDescription;
    }

    public void setOtherPlDescription(String otherPlDescription) {
        this.otherPlDescription = otherPlDescription;
    }

    public Long getReserveFund() {
        return reserveFund;
    }

    public void setReserveFund(Long reserveFund) {
        this.reserveFund = reserveFund;
    }

    public Long getClearGroupNumber() {
        return clearGroupNumber;
    }

    public void setClearGroupNumber(Long clearGroupNumber) {
        this.clearGroupNumber = clearGroupNumber;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    @Override
    public String toString() {
        return "TransactionRecords{" +
                "id=" + id +
                ", settlementDate=" + settlementDate +
                ", contractCode='" + contractCode + '\'' +
                ", contractAbbreviation='" + contractAbbreviation + '\'' +
                ", tradeDirection=" + tradeDirection +
                ", positionAction=" + positionAction +
                ", executionPrice=" + executionPrice +
                ", executedQuantity=" + executedQuantity +
                ", executedAmount=" + executedAmount +
                ", orderPrice=" + orderPrice +
                ", orderQuantity=" + orderQuantity +
                ", optionType=" + optionType +
                ", covered=" + covered +
                ", orderId='" + orderId + '\'' +
                ", orderTime=" + orderTime +
                ", tradingMarket='" + tradingMarket + '\'' +
                ", contractNumber='" + contractNumber + '\'' +
                ", stampDutyRate=" + stampDutyRate +
                ", brokerageFee=" + brokerageFee +
                ", regulatoryFee=" + regulatoryFee +
                ", settlementFee=" + settlementFee +
                ", transferFee=" + transferFee +
                ", transactionTransferFee=" + transactionTransferFee +
                ", exerciseTransferFee=" + exerciseTransferFee +
                ", transactionLevy=" + transactionLevy +
                ", commission=" + commission +
                ", settlementAmount=" + settlementAmount +
                ", profitGroup='" + profitGroup + '\'' +
                ", deliveryMonth='" + deliveryMonth + '\'' +
                ", clearFlag=" + clearFlag +
                ", leverageQuantity=" + leverageQuantity +
                ", otherPlFee=" + otherPlFee +
                ", otherPlDescription='" + otherPlDescription + '\'' +
                ", reserveFund=" + reserveFund +
                ", clearGroupNumber=" + clearGroupNumber +
                ", createdAt=" + createdAt +
                ", updatedAt=" + updatedAt +
                '}';
    }
}
